// @ts-ignore
import VMdPreview from '@kangc/v-md-editor/lib/preview';
import '@kangc/v-md-editor/lib/style/preview.css';
// @ts-ignore
import githubTheme from '@kangc/v-md-editor/lib/theme/github.js';
import '@kangc/v-md-editor/lib/theme/style/github.css';

// highlightjs > 代码高亮
import hljs from 'highlight.js';
VMdPreview.xss.extend({
    // 扩展白名单,不设置的话iframe不会进行转译
    whiteList: {
        iframe: ['src'],
    },
});
VMdPreview.use(githubTheme, {
    Hljs: hljs,
});

export default defineNuxtPlugin((nuxtApp) => {
    nuxtApp.vueApp.use(VMdPreview)
})
